export default {
  namespaced: true,
  state: {
    user: undefined,
    permissions: null,
    menuData: [],
    roles: null,
    routesConfig: null
  },
  getters: {
    user: state => {
      return state.user || {}
    },
    permissions: state => {
      return state.permissions
    },
    roles: state => {
      return state.roles
    },
    routesConfig: state => {
      return state.routesConfig
    }
  },
  mutations: {
    setUser (state, user) {
      state.user = user
    },
    setPermissions(state, permissions) {
      state.permissions = permissions
    },
    setMenuData(state, menuData) {
      state.permissions = menuData
    },
    setRoles(state, roles) {
      state.roles = roles
    },
    setRoutesConfig(state, routesConfig) {
      state.routesConfig = routesConfig
    }
  }
}
